function [log_likelihood]=ml_risk_simple_ind_cdf(theta)
%%% Gives likelihood of observing an individual's 55 lottery choices under
%%% CRRA utility



 global lottery_n theta_xy lottery_n lottery_choice_ind ind   
    
    likelihood_multiplier=2;
    
    rows=1;

     
    %%% parameter assignment for risk analysis
    
    theta_mean=theta(1);
    kappa_mean=theta(2);
    sig_th_mean=theta(3);
    theta(1:3)=[];  

    %%% Individual's true (or average) coefficient of risk aversion
    theta_i=repmat(theta_mean,1,lottery_n);
    
    %%% Individual's trembling hand parameter     
    kappa_l=0.5*normcdf(repmat(kappa_mean,1,lottery_n));    
    
    %%% individual variability of risk aversion 
    sig_th_l=normcdf(repmat(sig_th_mean,1,lottery_n));
          

    %%% difference between an individual's true (or average) coefficient of
    %%% risk aversion and the threshold level of indifference for lottery
    %%% task l
    theta_xy_comp=theta_xy;
    theta_diff=(bsxfun(@plus,theta_xy_comp,-theta_i));
    temp=zeros(size(theta_diff));
    for l=1:lottery_n
        temp(:,l)=theta_diff(:,l)./sig_th_l(:,l);
    end
    
    %%% Probability of choosing the riskier option 
    p_risky=normcdf(temp);
    p_safe=1-normcdf(temp);

    % kappa percent of the time an individual makes the wrong choice.
    choice_risky=zeros(size(p_risky));
    for l=1:lottery_n
        choice_risky(:,l)=p_risky(:,l).*(1-kappa_l(:,l))+p_safe(:,l).*kappa_l(:,l);
    end
    choice_safe=1-choice_risky;
    sim_l_contrib_lottery=(choice_risky.^(lottery_choice_ind(ind,:))).*(choice_safe.^(1-lottery_choice_ind(ind,:)));
    
    %%% full likelihood contribution vector
    sim_l_contrib_total=[sim_l_contrib_lottery];

   
    %%% for numerical optimization
    sim_l_contrib_total_plus=sim_l_contrib_total*likelihood_multiplier;
   
    %%% full likelihood contribution 
    sim_ind_draw_contrib=prod(sim_l_contrib_total_plus,2);
    
    %%% log likelihood
    log_likelihood=-sim_ind_draw_contrib;

    
end